<?php
class BaseAction extends Action {
	public function _initialize() {
		// 顶部广告位
		$topimg = M ( "advertising" )->where ( "place=1" )->order ( 'id desc' )->limit ( "1" )->select ();
		$this->assign ( "topimg", $topimg );
		// 上部广告位
		$onimg = M ( "advertising" )->where ( "place=2" )->order ( 'id desc' )->limit ( "4" )->select ();
		$this->assign ( "onimg", $onimg );
		// 中上部图片
		$middleup = M ( "advertising" )->where ( "place=3" )->order ( 'id desc' )->limit ( "1" )->select ();
		$this->assign ( "middleup", $middleup );
		// 中部图片
		$middle = M ( "advertising" )->where ( "place=4" )->order ( 'id desc' )->limit ( "3" )->select ();
		$this->assign ( "middle", $middle );
		// 中下部图片
		$middlelower = M ( "advertising" )->where ( "place=5" )->order ( 'id desc' )->limit ( "1" )->select ();
		$this->assign ( "middlelower", $middlelower );
		// 下部图片
		$lower = M ( "advertising" )->where ( "place=6" )->order ( 'id desc' )->limit ( "4" )->select ();
		$this->assign ( "lower", $lower );
		// 底部图片
		$bottom = M ( "advertising" )->where ( "place=6" )->order ( 'id desc' )->limit ( "4" )->select ();
		$this->assign ( "bottom", $bottom );
		
		// 友情链接
		$furl = M ( "friendurl" )->order ( 'f_sate desc' )->select ();
		$this->assign ( "furl", $furl );
		
		// 底部链接
		$foot_link = M ( "footlink" )->order ( 'sorts asc' )->select ();
		$this->assign ( "foot_link", $foot_link );
		
		// 精品写字楼出租
		$xrtuijian = M ( "xiezilou" )->join ( "area ON xiezilou.x_quyu = area.a_id" )->join ( "rent ON rent.r_id = xiezilou.x_zulin" )->where ( "xiezilou.is_jingpin=1 and xiezilou.x_zulin=1" )->field ( "xiezilou.x_name,xiezilou.x_m_rent,xiezilou.x_id" )->limit ( "15" )->select ();
		$this->assign ( "xrtuijian", $xrtuijian );
		// 精品写字楼出售
		$xstuijian = M ( "xiezilou" )->join ( "area ON xiezilou.x_quyu = area.a_id" )->join ( "rent ON rent.r_id = xiezilou.x_zulin" )->where ( "xiezilou.is_jingpin=1 and xiezilou.x_zulin=1" )->field ( "xiezilou.x_zongjia,xiezilou.x_name,xiezilou.x_id" )->limit ( "15" )->select ();
		$this->assign ( "xstuijian", $xstuijian );
		
		// 写字楼咨询
		$news_xzx = M ( "news" )->field ( "news.id,newstype.type_name,news.title,news.content,news.times,news_subtype.new_s_name" )->join ( "newstype ON news.type = newstype.id" )->join ( "news_subtype ON news.subtype = news_subtype.new_s_id" )->where ( "newstype.type_name = '写字楼资讯'" )->order ( "times desc,id desc" )->limit ( "6" )->select ();
		
		// 热点新闻
		$news_xzx = M ( "news" )->field ( "news.id,newstype.type_name,news.title,news.content,news.times,news_subtype.new_s_name" )->join ( "newstype ON news.type = newstype.id" )->join ( "news_subtype ON news.subtype = news_subtype.new_s_id" )->where ( "newstype.type_name = '写字楼资讯'" )->order ( "times desc,id desc" )->limit ( "6" )->select ();
		$this->assign ( "news_xzx", $news_xzx );
	}
}

?>